package com.example.smartstart.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.smartstart.entity.Student;
import com.example.smartstart.entity.StudentInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface StudentMapper extends BaseMapper<Student> {

    @Select("select * from student where student_id = #{studentId} and password = #{password}")
    Student queryStudent(@Param("studentId")String studentId, @Param("password")String password);

    Integer queryTotal(Student student);

    List<Student> listByPage(Student student);

    @Update("update student set account_status = #{accountStatus} where id = #{id}")
    Integer updateStatus(Integer id, String accountStatus);

    @Select("select id from student where student_id = #{studentId}")
    Integer getUserId(String studentId);
}
